imagefontforecolorpicker = new Image();
imagefontforecolorpicker.src = "RichEditor/fontforecolorpicker.gif";
imagefontforecolorpickero = new Image(); 
imagefontforecolorpickero.src = "RichEditor/fontforecolorpicker_over.gif";
imagefontbackcolorpicker = new Image();
imagefontbackcolorpicker.src = "RichEditor/fontbackcolorpicker.gif";
imagefontbackcolorpickero = new Image();
imagefontbackcolorpickero.src = "RichEditor/fontbackcolorpicker_over.gif";
imagebold = new Image();
imagebold.src = "RichEditor/bold.gif";
imageboldo = new Image();
imageboldo.src = "RichEditor/bold_over.gif";
imageitalic = new Image();
imageitalic.src = "RichEditor/italic.gif";
imageitalico = new Image();
imageitalico.src = "RichEditor/italic_over.gif";
imageunderline = new Image();
imageunderline.src = "RichEditor/underline.gif";
imageunderlineo = new Image();
imageunderlineo.src = "RichEditor/underline_over.gif";
imagesuperscript = new Image();
imagesuperscript.src = "RichEditor/superscript.gif"; 
imagesuperscripto = new Image(); 
imagesuperscripto.src = "RichEditor/superscript_over.gif"; 
imagesubscript = new Image(); 
imagesubscript.src = "RichEditor/subscript.gif"; 
imagesubscripto = new Image(); 
imagesubscripto.src = "RichEditor/subscript_over.gif"; 
imagestrikethrough = new Image(); 
imagestrikethrough.src = "RichEditor/strikethrough.gif"; 
imagestrikethrougho = new Image(); 
imagestrikethrougho.src = "RichEditor/strikethrough_over.gif"; 
imageleftjustify = new Image(); 
imageleftjustify.src = "RichEditor/leftjustify.gif"; 
imageleftjustifyo = new Image(); 
imageleftjustifyo.src = "RichEditor/leftjustify_over.gif"; 
imagecenterjustify = new Image();
imagecenterjustify.src = "RichEditor/centerjustify.gif"; 
imagecenterjustifyo = new Image(); 
imagecenterjustifyo.src = "RichEditor/centerjustify_over.gif"; 
imagerightjustify = new Image(); 
imagerightjustify.src = "RichEditor/rightjustify.gif"; 
imagerightjustifyo = new Image(); 
imagerightjustifyo.src = "RichEditor/rightjustify_over.gif"; 
imagenumberedlist = new Image(); 
imagenumberedlist.src = "RichEditor/numberedlist.gif";
imagenumberedlisto = new Image();
imagenumberedlisto.src = "RichEditor/numberedlist_over.gif"; 
imagebullets = new Image(); 
imagebullets.src = "RichEditor/bullets.gif"; 
imagebulletso = new Image(); 
imagebulletso.src = "RichEditor/bullets_over.gif"; 
imageoutdent = new Image(); 
imageoutdent.src = "RichEditor/outdent.gif"; 
imageoutdento = new Image(); 
imageoutdento.src = "RichEditor/outdent_over.gif"; 
imageindent = new Image(); 
imageindent.src = "RichEditor/indent.gif"; 
imageindento = new Image(); 
imageindento.src = "RichEditor/indent_over.gif"; 
imagecut = new Image(); 
imagecut.src = "RichEditor/cut.gif"; 
imagecuto = new Image(); 
imagecuto.src = "RichEditor/cut_over.gif"; 
imagecopy = new Image(); 
imagecopy.src = "RichEditor/copy.gif"; 
imagecopyo = new Image(); 
imagecopyo.src = "RichEditor/copy_over.gif"; 
imagepaste = new Image(); 
imagepaste.src = "RichEditor/paste.gif"; 
imagepasteo = new Image(); 
imagepasteo.src = "RichEditor/paste_over.gif"; 
imageundo = new Image(); 
imageundo.src = "RichEditor/undo.gif"; 
imageundoo = new Image(); 
imageundoo.src = "RichEditor/undo_over.gif"; 
imageredo = new Image(); 
imageredo.src = "RichEditor/redo.gif"; 
imageredoo = new Image(); 
imageredoo.src = "RichEditor/redo_over.gif"; 
imageinsertimage = new Image(); 
imageinsertimage.src = "RichEditor/insertimage.gif"; 
imageinsertimageo = new Image(); 
imageinsertimageo.src = "RichEditor/insertimage_over.gif"; 
imageinsertlink = new Image(); 
imageinsertlink.src = "RichEditor/insertlink.gif"; 
imageinsertlinko = new Image(); 
imageinsertlinko.src = "RichEditor/insertlink_over.gif"; 
imageinsertrule = new Image(); 
imageinsertrule.src = "RichEditor/insertrule.gif"; 
imageinsertruleo = new Image(); 
imageinsertruleo.src = "RichEditor/insertrule_over.gif"; 
imageprint = new Image(); 
imageprint.src = "RichEditor/print.gif"; 
imageprinto = new Image(); 
imageprinto.src = "RichEditor/print_over.gif"; 
imagehelp = new Image(); 
imagehelp.src = "RichEditor/help.gif"; 
imagehelpo = new Image(); 
imagehelpo.src = "RichEditor/help_over.gif"; 
imagesave = new Image(); 
imagesave.src = "RichEditor/save.gif"; 
imagesaveo = new Image(); 
imagesaveo.src = "RichEditor/save_over.gif"; 
imageinserttable = new Image(); 
imageinserttable.src = "RichEditor/inserttable.gif"; 
imageinserttableo = new Image(); 
imageinserttableo.src = "RichEditor/inserttable_over.gif"; 
imageinsertrow = new Image(); 
imageinsertrow.src = "RichEditor/insertrow.gif"; 
imageinsertrowo = new Image(); 
imageinsertrowo.src = "RichEditor/insertrow_over.gif"; 
imageinsertcolumn = new Image(); 
imageinsertcolumn.src = "RichEditor/insertcolumn.gif"; 
imageinsertcolumno = new Image(); 
imageinsertcolumno.src = "RichEditor/insertcolumn_over.gif"; 
imagedeleterow = new Image(); 
imagedeleterow.src = "RichEditor/deleterow.gif"; 
imagedeleterowo = new Image(); 
imagedeleterowo.src = "RichEditor/deleterow_over.gif"; 
imagedeletecolumn = new Image(); 
imagedeletecolumn.src = "RichEditor/deletecolumn.gif"; 
imagedeletecolumno = new Image(); 
imagedeletecolumno.src = "RichEditor/deletecolumn_over.gif"; 
imageinsertdate = new Image(); 
imageinsertdate.src = "RichEditor/insertdate.gif"; 
imageinsertdateo = new Image(); 
imageinsertdateo.src = "RichEditor/insertdate_over.gif"; 
imageinserttime = new Image(); 
imageinserttime.src = "RichEditor/inserttime.gif"; 
imageinserttimeo = new Image(); 
imageinserttimeo.src = "RichEditor/inserttime_over.gif"; 
imagedesign = new Image(); 
imagedesign.src = "RichEditor/design.gif"; 
imagedesigno = new Image(); 
imagedesigno.src = "RichEditor/design_over.gif"; 
imagecode = new Image(); 
imagecode.src = "RichEditor/code.gif"; 
imagecodeo = new Image(); 
imagecodeo.src = "RichEditor/code_over.gif"; 

function ChangeMode(editor,toolbarID,newSetting,autohide){
	var toolbar = document.getElementById(toolbarID);
	var sTmp;
	if (newSetting){
		sTmp=editor.document.body.innerHTML;
		editor.document.styleSheets[0].disabled = true;
		editor.document.styleSheets[1].disabled = false;
		if (toolbar != null && autohide){
			toolbar.style.display = 'none';
		}
		editor.document.body.innerText=sTmp;
	}
	else{
		sTmp=editor.document.body.innerText;
		editor.document.styleSheets[0].disabled = false;
		editor.document.styleSheets[1].disabled = true;
		if (toolbar != null && autohide){
			toolbar.style.display = 'inline';
		}
	editor.document.body.innerHTML=sTmp;
	}
	editor.focus(); 
}

function onKeyDown_RichTxt(){
	editor = myx5;
	if (myx5.event.keyCode == 9){
		myx5.event.cancelBubble = true;
		myx5.event.returnValue = false;
	}
}

function mySetChk(){
	document.getElementById('myShowHTML').checked = false
}

	Setup(myx5,document.getElementById('RichTxt'));
	myx5.focus();
	myx5.document.onkeydown = onKeyDown_RichTxt;
	document.getElementById('myx5').document.body.onload = mySetChk;